const { LinValidator, Rule } = require('../../core/lin-validator-v2')

class ProductQueryValidator extends LinValidator {
  constructor() {
    super()
    this.pageIndex = [
      new Rule('isInt', '页索引必须是正整数', { min: 1 })
    ]
    this.pageSize = [
      new Rule('isInt', '页大小必须是正整数', { min: 1 })
    ]
  }
}

class TopNumValidator extends LinValidator {
  constructor() {
    super()
    this.top = [
      new Rule('isInt', '数量值必须是正整数', { min: 1 })
    ]
  }
}

module.exports = {
  ProductQueryValidator,
  TopNumValidator
}